/**
 * 
 */
package com.guchenbo.example.procon;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.DefaultConfigurationBuilder;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.junit.Test;

/**
 * @author Cre.Gu
 *
 */
public class PropertiesConfigurationTest {

	@Test
	public void test() throws ConfigurationException {
		Configuration config = new PropertiesConfiguration(
				"procon/usergui.properties");

		String backColor = config.getString("colors.background");
		System.out.println(backColor);
		System.out.println(config.getInt("window.height"));

		System.out.println(config.getString("filename"));
	}

	@Test
	public void complex() throws ConfigurationException {
		DefaultConfigurationBuilder factory = new DefaultConfigurationBuilder(
				"procon/config.xml");
		Configuration config = factory.getConfiguration();

		String backColor = config.getString("colors.background");
		System.out.println(backColor);
		System.out.println(config.getInt("window.height"));

		System.out.println(config.getString("filename"));

		System.out.println(config.getString("java.home"));
	}
}
